<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><script type="text/javascript">
        $(function() {
                $('.deloneCart').click(function() {
                        var oSid = $(this).attr('sid');
                        var _this = $(this);
                        $.ajax({
                                url: 'http://localhost/shopFrame/Index' + '&c=ShopCart&a=del_cart',
                                data: {sid: oSid},
                                dataType: 'json',
                                type: 'post',
                                success: function(data) {
                                        _this.parents('li').remove();
                                        $('#shopping_num').html(data.total_rows);
                                        $('.totalbuy .total_price p').html(data.total_rows);
                                        $('.totalbuy .total_price h3').html('￥' + data.total);
                                }
                        })
                })
        })
</script>
<style type="text/css">
        body{
                background: white;
        }
</style>
</head>
<body>
        <!-- 顶部区域开始 -->
        <div id="header">
                <div class="header_w">
                        <!-- 收藏京北区域 -->
                        <ul class='favicons fl'>
                                <li>
                                        <b></b>
                                        <a href='#'>收藏京北</a>
                                </li>
                        </ul>
                        <!-- 收藏京北区域结束 -->
                        <!-- 更换地址区域 -->
                        <!--                        <dl class='home-area fl'>
                                                        <dt>
                                                        <b></b>
                                                        <strong>北京</strong>
                                                        <a href="#" class='cha_pos'>[更换]</a>
                                                        </dt>
                                                        <dd class='d_hidden' id='place'>
                                                                <ul>
                                                                        <li><a href="#">北京</a></li>
                                                                        <li><a href="#">上海</a></li>
                                                                        <li><a href="#">天津</a></li>
                                                                        <li><a href="#">南京</a></li>
                                                                        <li><a href="#">北京</a></li>
                                                                        <li><a href="#">上海</a></li>
                                                                        <li><a href="#">天津</a></li>
                                                                        <li><a href="#">南京</a></li>
                                                                        <li><a href="#">北京</a></li>
                                                                        <li><a href="#">上海</a></li>
                                                                        <li><a href="#">天津</a></li>
                                                                        <li><a href="#">南京</a></li>
                                                                </ul>
                                                        </dd>
                                                </dl>-->
                        <!-- 更换地址区域结束 -->
                        <!-- 欢迎来到京北右侧等等区域 -->
                        <ul class="header_right fr">
                                <?php if($_SESSION['username'] and $_SESSION['uid']){?>
                                        <li id='login_bar' class='fl'><?php echo $_SESSION['username'];?>，欢迎来到京北 <span><a href="<?php echo U('Login/out');?>">[退出]</a></span></li>
                                        <li class='my_order fl line'>|<a href="<?php echo U('Member/myorder');?>">我的订单</a>|</li>
                                        <?php  }else{ ?>
                                                <li id='login_bar' class='fl'>您好，欢迎来到京北 <span><a href="<?php echo U('Login/index');?>">[登陆]</a><a href="<?php echo U('Register/index');?>">[注册]</a></span></li>
                                <?php }?>
                                <!--<li class='m_club fl line_r'><b></b><a href="#">会员俱乐部</a>|</li>-->
                                <!-- <li class='app_jd fl'><b></b><a href="#">手机京北</a><i></i>|</li> -->
                                <!--                                <li class='service fl'>
                                                                        <span class="outline"></span>
                                                                        <span class="blank"></span>
                                                                        客户服务
                                                                        <i></i>
                                                                        <div class="service_list">
                                                                                <a href="#">售后服务</a>
                                                                                <a href="#">在线客服</a>
                                                                                <a href="#">投诉中心</a>
                                                                                <a href="#">客服邮箱</a>
                                                                        </div>
                                                                </li>
                                                                <li class='site_map fl'><s></s>
                                                                网站导航
                                                                <span class="outline"></span>
                                                                <span class="blank"></span>
                                                                <i></i>
                                                                <dl class="site_special">
                                                                        <dt>特色栏目</dt>
                                                                        <dd><div class="list_1">
                                                                                        <a href="#">京北通信</a>
                                                                                        <a href="#">校园之星</a>
                                                                                        <a href="#">视频购物</a>
                                                                                        <a href="#">京北社区</a>
                                                                                        <a href="#">在线读书</a>
                                                                                        <a href="#">装机大师</a>
                                                                                        <a href="#">家装城</a>
                                                                                        <a href="#">我喜欢</a>
                                                                                        <a href="#">搭配购</a>
                                                                                </div></dd>
                                                                </dl>
                                                                </li>-->
                        </ul>
                        <!-- 欢迎来到京北右侧等等区域结束 -->
                </div>
        </div>
        <!-- 顶部区域结束 -->
        <!-- 顶部logo区域开始 -->
        <div id="logo_area">
                <a href="<?php echo U('Index/index');?>"><img src="http://localhost/shopFrame/Application/Index/View/Public/images/logo-201305.png" alt="" /></a>
                <!-- 搜索块区域 -->
                <div class='form'>
                        <form action="<?php echo U('List/search');?>" method="post">
                                <input type="text" name="search" class='text' />
                                <input type="submit"  class='button' value='搜索'/>
                </div>
                <!-- 搜索快区域结束 -->
                <!-- 我的京北区域 -->
                <div class="my_jd ">
                        <dl class='my_jd_area'>
                                <dt>
                                <b></b>
                                <?php if($_SESSION['username']){?>
                                        <a href="<?php echo U('Member/index');?>">我的京北</a>
                                        <?php  }else{ ?>
                                                <a href="<?php echo U('Login/index');?>">我的京北</a>
                                <?php }?>

                                <i></i>
                                </dt>
                                <s></s>
                                <dd>
                                <?php if($_SESSION['username'] && $_SESSION['uid']){?>
                                        <div class='prompt_islogin'><?php echo $_SESSION['username'];?><a href="<?php echo U('Member/index');?>">去我的京北首页</a>
                                        </div>
                                        <?php  }else{ ?>
                                                <div class='prompt'>
                                                        您好，请<a href="#">登陆</a>
                                                </div> 
                                <?php }?>
                                <div class="uclist">
                                        <ul class='list_1'>
                                                <li><a href="#">待处理订单</a></li>
                                                <li><a href="#">咨询回复</a></li>
                                                <li><a href="#">降价商品</a></li>
                                                <li><a href="#">返修退换货</a></li>
                                                <li><a href="#">优惠券</a></li>
                                        </ul>
                                        <ul class='list_2'>
                                                <li><a href="#">我的关注 ></a></li>
                                                <li><a href="#">我的京豆 ></a></li>
                                                <li><a href="#">我的理财 ></a></li>
                                                <li><a href="#">我的白条 ></a></li>
                                        </ul>
                                </div>
                                </dd>
                        </dl>

                </div>
                <!-- 我的京北区域结束 -->
                <!-- 我的购物车区域 -->
                <div class="my_car">
                        <b></b>
                        <a href="#">去购物车结算</a>
                        <i></i>
                        <s></s>
                        <div class='shopping'>
                                <p id='shopping_num'><?php if($allCart['goods']){?><?php echo $allCart['total_rows'];?><?php  }else{ ?>0<?php }?></p>
                        </div>
                        <div class="car_shop">
                                <?php if($cartData){?>
                                        <strong>最新加入的商品</strong>
                                        <ul class='list_all'>
                                                <?php if(is_array($cartData)){?><?php  foreach($cartData as $k=>$v){ ?>
                                                        <li>
                                                                <div class="p_img">
                                                                        <a href='<?php echo U("Content/index",array("gid"=>$v["option"]["gid"]));?>'><img src='http://localhost/shopFrame/<?php echo $v['option']['thumb'];?>' width="50" height="50"/></a>
                                                                </div>
                                                                <div class="p_title">
                                                                        <a href='<?php echo U("Content/index",array("gid"=>$v["option"]["gid"]));?>' title="<?php echo $v['name'];?>"><?php echo hd_substr($v['name'],45,'');?><h2>&nbsp;<?php echo $v['option']['stand'];?></h2></a>
                                                                </div>
                                                                <div class="p_price">
                                                                        <strong>￥<?php echo $v['price'];?></strong>
                                                                        <p>x<?php echo $v['num'];?></p>
                                                                        <a href='javascript:;' sid='<?php echo $k;?>' class='deloneCart'>删除</a>
                                                                </div>
                                                        </li>
                                                <?php }}?>
                                        </ul>
                                        <div class="totalbuy">
                                                <div class="total_price">
                                                        共<p><?php echo $allCart['total_rows'];?></p>件商品&nbsp;&nbsp;&nbsp;共计&nbsp;<h3>￥<?php echo $allCart['total'];?></h3>
                                                </div>
                                                <div class="buybutton"><a href="<?php echo U('ShopCart/index');?>">去购物车结算</a></div>
                                        </div>
                                        <?php  }else{ ?>
                                                <span></span>购物车中还没有商品，赶紧选购吧！
                                <?php }?>
                        </div>
                </div>
                <!-- 我的购物车区域结束 -->
                <div id="report_center">
                        <a href="#"><img src="http://localhost/shopFrame/Application/Index/View/Public/images/baokong.png" alt="" /></a>
                </div>
        </div>	
        <!-- 顶部logo区域结束 -->
        <!-- 顶部导航区域 -->
        <div id="nav">
                <!-- 导航左部区域 -->
                <div class="nav_l">
                        <h2>
                                <a href="javascript:;" class='all_shop'>全部商品分类</a>
                                <b></b>
                        </h2>
                        <div class="cate_l">
                                <?php if(is_array($Type)){?><?php  foreach($Type as $k=>$v){ ?>
                                        <div class='item  <?php if($k == 0){?> first<?php }?>'>
                                                <div class="item_title "><p>
                                                        <?php if(is_array($typeCon)){?><?php  foreach($typeCon as $key=>$s){ ?>
                                                                <?php if($s['tsort'] == $v['tsort']){?>
                                                                        <a href="<?php echo U('List/index',array('tid'=>$s['tid']));?>"><?php echo $s['tname'];?></a>&nbsp;
                                                                <?php }?>
                                                        <?php }}?>
                                                        <s></s></p><i></i>
                                                </div>
                                                <div class="list_area">
                                                        <div class="left_list">
                                                                <?php if(is_array($data)){?><?php  foreach($data as $n=>$c){ ?>
                                                                        <?php if($v['tsort'] == $c['tsort']){?>
                                                                                <dl>
                                                                                        <dt>
                                                                                        <a href="javascript:;" style='text-decoration: none;cursor:default;'><?php echo $c['cname'];?></a>
                                                                                        </dt>
                                                                                        <dd>
                                                                                        <?php if(is_array($c['son'])){?><?php  foreach($c['son'] as $key=>$s){ ?>
                                                                                                <a href="<?php echo U('List/index',array('cid'=>$s['cid']));?>"><?php echo $s['cname'];?></a>
                                                                                        <?php }}?>
                                                                                        </dd>
                                                                                </dl>
                                                                        <?php }?>
                                                                <?php }}?>
                                                        </div>
                                                        <div class="right_list">
                                                                <dl>
                                                                        <dt>推荐品牌</dt>
                                                                        <dd>
                                                                                <?php $hd["list"]["b"]["total"]=0;if(isset($brand) && !empty($brand)):$_id_b=0;$_index_b=0;$lastb=min(8,count($brand));
$hd["list"]["b"]["first"]=true;
$hd["list"]["b"]["last"]=false;
$_total_b=ceil($lastb/1);$hd["list"]["b"]["total"]=$_total_b;
$_data_b = array_slice($brand,0,$lastb);
if(count($_data_b)==0):echo "";
else:
foreach($_data_b as $key=>$b):
if(($_id_b)%1==0):$_id_b++;else:$_id_b++;continue;endif;
$hd["list"]["b"]["index"]=++$_index_b;
if($_index_b>=$_total_b):$hd["list"]["b"]["last"]=true;endif;?>

                                                                        <?php if($b['tsort'] == $v['tsort']){?>
                                                                                <a href="javascript:"><img src="http://localhost/shopFrame/<?php echo $b['logo'];?>"/></a>
                                                                        <?php }?>
                                                                        <?php $hd["list"]["b"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
                                                                        </dd>
                                                                </dl>
                                                        </div>
                                                </div>
                                        </div>
                                <?php }}?> 
                        </div>
                </div>
                <!-- 导航左部区域结束 -->
                <!-- 导航右部区域 -->
                <ul class="nav_r">
                        <li><a href="<?php echo U('Index/index');?>" class='first_nav'>首页</a></li>
                        <?php $hd["list"]["v"]["total"]=0;if(isset($Type) && !empty($Type)):$_id_v=0;$_index_v=0;$lastv=min(5,count($Type));
$hd["list"]["v"]["first"]=true;
$hd["list"]["v"]["last"]=false;
$_total_v=ceil($lastv/1);$hd["list"]["v"]["total"]=$_total_v;
$_data_v = array_slice($Type,0,$lastv);
if(count($_data_v)==0):echo "";
else:
foreach($_data_v as $key=>$v):
if(($_id_v)%1==0):$_id_v++;else:$_id_v++;continue;endif;
$hd["list"]["v"]["index"]=++$_index_v;
if($_index_v>=$_total_v):$hd["list"]["v"]["last"]=true;endif;?>

                        <li><a href="<?php echo U('List/index',array('tid'=>$v['tid']));?>"><?php echo $v['tname'];?></a></li>
                        <?php $hd["list"]["v"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>

                </ul>
                <p class="nav_r_ads">
                        <a href="#"><img src="http://localhost/shopFrame/Application/Index/View/Public/images/nav_ads.png"  /></a>
                </p>
                <!-- 导航右部区域结束 -->
        </div>
        <!-- 导航区域结束 -->